<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>05_条件渲染</title>
    <script src="../node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id=app>
        <button v-on:click="flag = !flag">切换</button>
    <div v-if="flag">这是用v-if渲染的元素</div>    
    <div v-show="flag">这是用v-show渲染的元素</div>    
    </div>

    <script>
        const vm = new Vue({
            el:'#app',
            data:{
                flag: true
            },
            // methods:{
            //     toggle(){
            //         this.flag = !this.flag;
            //     }
            // }
        });
    </script>
</body>
</html>